<?php
namespace ZHMVC\DB\MANAGER;

if (! isset($_SESSION)) {
    session_start();
}
include (dirname(dirname(__FILE__)) . "/zhconfig/Config.php");
include (ZH_PATH . DS . MANAGERFPATH . DS . 'islogin' . ZH);
$isp = new \ZHMVC\D\MANAGER\isPermission();
$isper = $isp->getPermission();
$_curlid = $isp->getCUrl();
include (ZH_PATH . DS . MANAGERFPATH . DS . 'top1' . ZH);

function tc($temp)
{
    if ($temp == 1) {
        echo '<font color=green><b>√</b></font>';
    } else {
        echo '<font color=red><b>×</b></font>';
    }
}
?>
<div class="wap-container">
	<nav class="breadcrumb" style="background-color: #fff; padding: 0 24px">
		我的桌面 <a class="btn btn-success radius f-r"
			style="line-height: 1.6em; margin-top: 3px"
			href="javascript:location.replace(location.href);" title="刷新"><i
			class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
	<!--/_header 作为公共模版分离出去-->
	<article class="Hui-admin-content clearfix">
		<div class="panel">
			<div class="panel-body">
				<div class="row-24 clearfix"
					style="margin-left: -12px; margin-right: -12px;">
					<div
						class="col-24-xs-24 col-24-sm-12 col-24-md-12 col-24-lg-12 col-24-xl-6"
						style="padding-left: 12px; padding-right: 12px; margin-bottom: 24px;">
						<div class="panel">
							<div class="panel-header"
								style="padding: 15px 24px; font-weight: 400; color: #999;">总销售额：</div>
							<div class="panel-body" style="padding: 0 24px;">
								<div class="c-primary"
									style="font-size: 30px; line-height: 38px; padding-bottom: 24px;">
									&yen; 0</div>
								<div class="f-14"
									style="padding: 10px 0; border-top: solid 1px #eee">
									<span class="c-999">今日销售额</span> <span>&yen; 0</span>
								</div>
							</div>
						</div>
					</div>
					<div
						class="col-24-xs-24 col-24-sm-12 col-24-md-12 col-24-lg-12 col-24-xl-6"
						style="padding-left: 12px; padding-right: 12px; margin-bottom: 24px;">
						<div class="panel">
							<div class="panel-header"
								style="padding: 15px 24px; font-weight: 400; color: #999;">总会员数：</div>
							<div class="panel-body" style="padding: 0 24px;">
								<div class="c-danger"
									style="font-size: 30px; line-height: 38px; padding-bottom: 24px;">
									0 人</div>
								<div class="f-14"
									style="padding: 10px 0; border-top: solid 1px #eee">
									<span class="c-999">今日新增会员</span> <span>0 人</span>
								</div>
							</div>
						</div>
					</div>
					<div
						class="col-24-xs-24 col-24-sm-12 col-24-md-12 col-24-lg-12 col-24-xl-6"
						style="padding-left: 12px; padding-right: 12px; margin-bottom: 24px;">
						<div class="panel">
							<div class="panel-header"
								style="padding: 15px 24px; font-weight: 400; color: #999;">总订单数：</div>
							<div class="panel-body" style="padding: 0 24px;">
								<div class="c-warning"
									style="font-size: 30px; line-height: 38px; padding-bottom: 24px;">
									0</div>
								<div class="f-14"
									style="padding: 10px 0; border-top: solid 1px #eee">
									<span class="c-999">今日订单</span> <span>0</span>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="panel">
					<div class="panel-header">销量图(当前数据为模拟数据)</div>
					<div class="panel-body">
						<div class="Hui-admin-datetime-select">
							<span onclick="newUser('day',this)" class="active">天</span> <span
								onclick="newUser('week',this)">周</span> <span
								onclick="newUser('month',this)">月</span>
						</div>
						<div id="echarts-1" style="height: 400px"></div>
					</div>
				</div>
			</div>
		</div>
	</article>
	<footer class="footer Hui-admin-footer">
		<p></p>
	</footer>
</div>
<?php
include (ZH_PATH . DS . MANAGERFPATH . DS . 'foot1' . ZH);
?>
<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript" src="/common/hui/lib/echarts/4.1.0.rc2/echarts.min.js"></script>
	<script type="text/javascript">
	function newUser(type,obj){
    $(obj).parent().find("span").removeClass("active");
    $(obj).addClass("active");
    var xData = [];
    var yData1 = [];
    var yData2 = [];

    // 天
    if(type == 'day'){
      xData = [
        '2018-01-01',
        '2018-01-02',
        '2018-01-03',
        '2018-01-04',
        '2018-01-05',
        '2018-01-06',
        '2018-01-07',
        '2018-01-08',
        '2018-01-09',
        '2018-01-10',
        '2018-01-11',
        '2018-01-12',
        '2018-01-12',
        '2018-01-13',
        '2018-01-14',
        '2018-01-15',
        '2018-01-16',
        '2018-01-17',
        '2018-01-18',
        '2018-01-19',
        '2018-01-20',
        '2018-01-21',
        '2018-01-22',
        '2018-01-23',
        '2018-01-24',
        '2018-01-25',
        '2018-01-26',
        '2018-01-27',
        '2018-01-28',
        '2018-01-29',
        '2018-01-30',
        '2018-01-31',
      ];
      yData1 =[
        1200,
        1400,
        1200,
        1400,
        1200,
        1400,
        1200,
        1400,
        1200,
        1400,
        1200,
        1400,
        1200,
        1400,
        1200,
        1400,
        1200,
        1400,
        1200,
        1400,
        1200,
        1400,
        1200,
        1400,
        1200,
        1400,
        1200,
        1400,
        1200,
        1400,
        1200,
      ];
      yData2 = [
        120,
        140,
        120,
        140,
        120,
        140,
        120,
        140,
        120,
        120,
        20,
        100,
        39,
        49,
        38,
        78,
        5,
        66,
        33,
        22,
        44,
        55,
        23,
        11,
        32,
        34,
        55,
        22,
        33,
        55,
        77,
      ];
    }

    // 周
    if(type == 'week') {
      xData = [];
      yData1 = [];
      yData2 = [];
    }

    // 月
    if(type == 'month'){
      xData = [];
      yData1 = [];
      yData2 = [];
    }
		var echarts1 = echarts.init(document.getElementById('echarts-1'));
    var echarts1_option = {
      title: {
        show: false,
      },
      tooltip: {
        trigger: 'axis'
      },
      legend: {
        x : 'center',
        y : 'top',
        data: ['会员','非会员']
      },
      xAxis: {
        data: xData,
      },
      yAxis:{
        type: 'value',
        nameTextStyle: {
          // 坐标轴名称的文字样式
        },
        axisLine: {
          // 坐标轴轴线相关设置
        }
      },
      series: [
        {
          name: '会员',
          type: 'line',
          symbolSize:10,
          symbol:'circle',
          itemStyle: {
            color: '#1bb495',
            bborderColor: '#fff',
          	borderWidth: 2,
          },
          data: yData1,
        },
        {
          name: '非会员',
          type: 'line',
          symbolSize:10,
          symbol:'circle',
          itemStyle: {
            color: '#25c6c8',
            borderColor: '#fff',
          	borderWidth: 2,
          },
          data: yData2,
        }
      ]
    }
    echarts1.setOption(echarts1_option);
	}

	$(function () {
    newUser('day'); // 默认天
	});
	</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
